//
//  CXChannelCollectionResuableView.m
//  ProjectOfBStage
//
//  Created by cuixin on 15/11/13.
//  Copyright © 2015年 cuixin. All rights reserved.
//

#import "CXChannelCollectionResuableView.h"
#define KFont [UIFont systemFontOfSize:13]
@implementation CXChannelCollectionResuableView

-(void)dealloc{
    [_newwButton release];
    [_hotButton release];
    [super dealloc];
}

-(instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        
        self.hotButton = [UIButton buttonWithType:UIButtonTypeCustom];
        self.newwButton = [UIButton buttonWithType:UIButtonTypeCustom];
        
        [self.hotButton setTitle:@"最热" forState:UIControlStateNormal];
        [self.newwButton setTitle:@"最新" forState:UIControlStateNormal];
        
        self.hotButton.titleLabel.font = KFont;
        self.newwButton.titleLabel.font = KFont;
        
        self.hotButton.backgroundColor = [UIColor redColor];
        self.newwButton.backgroundColor = [UIColor cyanColor];
        
        [self.hotButton setTitleColor:[UIColor grayColor] forState:UIControlStateNormal];
        [self.newwButton setTitleColor:[UIColor grayColor] forState:UIControlStateNormal];
        
        [self addSubview:self.hotButton];
        [self addSubview:self.newwButton];
    }
    return self;
}

-(void)layoutSubviews{
    [super layoutSubviews];
    self.newwButton.frame = CGRectMake(self.frame.size.width - WIDTH_PRO(90), 0, WIDTH_PRO(40) , HEIGHT_PRO(20));
    self.hotButton.frame = CGRectMake(self.newwButton.frame.size.width + self.newwButton.frame.origin.x, self.newwButton.frame.origin.y, self.newwButton.frame.size.width, self.newwButton.frame.size.height);
}
@end
